<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function aaa() {
            var img=document.getElementById("img1");
            img.src="../resource/img/7.jpg";
        }
        //setInterval("aaa()",2000);

    </script>
</head>
<body>
<input type="button" value="换图片" onclick="aaa()">  <br>
<img src="../resource/img/6.jpg" alt="" id="img1">
</body>
</html>